package top.xunfong.system.factory;

import jakarta.annotation.PostConstruct;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import top.xunfong.common.core.domain.R;
import top.xunfong.common.core.domain.model.LoginUserInfo;
import top.xunfong.system.model.RemoteSysUserService;

/**
 * @author: xunfong
 * @date: 2025/10/17 10:09
 */

@Component
public class RemoteSysUserFallbackFactory implements FallbackFactory<RemoteSysUserService> {

    public RemoteSysUserFallbackFactory() {
        // 在构造函数设置断点
        System.out.println("RemoteSysUserFallbackFactory constructor called");
    }
    @Override
    public RemoteSysUserService create(Throwable cause) {
        return new RemoteSysUserService() {
            @Override
            public R<LoginUserInfo> login(String username, String source) {
                return R.fail();
            }
        };
    }
}
